package com.dgw.dao;

import com.dgw.domain.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @program: SSM-Vue
 * @description:
 * @author: Mr.Dai
 * @create: 2019-12-21 11:02
 **/
@Repository
public interface IUserDaoMapper {

    /**
     * 查询所有
     * @return
     */
    @Select("select * from user")
    List<User> findALL();

    /**
     *
     * @return
     */
    @Select("select * from user where id=#{id}")
    User findUserById(Integer id);

    /**
     *
     * @param user
     * @return
     */
    @Update("update user set username=#{username},password=#{password},age=#{age},sex=#{sex},email=#{email} where id=#{id}")
    int updateUser(User user);
}
